
// 路径配置
require.config({
    paths: {
        echarts: '../js'
    }
});
// 使用
require(
    [
        'echarts',
        'echarts/chart/line' 
    ],
    function (ec) {
        // 基于准备好的dom，初始化echarts图表
        var myChart = ec.init(document.getElementById('main')); 
        
        var option = {
		    tooltip : {
		        trigger: 'axis'
		    },
		    grid:{
		    	x:30,
		    	y:10,
		    	x2:1,
		    	y2:30
		    },
		    calculable : false,
		    xAxis : [
		        {
		            type : 'category',
		            boundaryGap : false,
		            data : ['2011-03-27','2011-04-01','2011-04-06','2011-04-11',
		            		'2011-04-16','2011-04-21','2011-04-26','2011-05-01',
		            		'2011-05-06','2011-05-11','2011-05-26','2011-05-31',
		            		'2011-06-06','2011-06-11','2011-06-16','2011-06-21',
		            		'2011-06-26','2011-07-01',
		            		],
		            axisLabel:{
		            	textStyle:{
		            		fontSize:10
		            	}
		            }
		        }
		    ],
		    yAxis : [
		        {
		            type : 'value',
		        }
		    ],
		    series : [
		        {
		            name:'商品种类',
		            type:'line',
		            itemStyle:{
		            	normal:{
		            		color:'#cabf83',
		            		lineStyle:{
		            			color:'#cabf83'
		            		},
		            	}
		            },
		            data:[20, 160, 40, 30, 70, 13, 20, 160, 40, 30,
		            	  70, 13, 40, 30, 70, 13, 20, 160, 40, 30,
		            	  ]
		        },
		    ]
		};
            

        // 为echarts对象加载数据 
        myChart.setOption(option);
        window.onresize = function () {
			myChart.resize(); //使第一个图表适应
		};
		function all(){

		};
		function year(){

		};
		function month(){

		};
    }
);